package org.devside.grails.mailqueue

import org.devside.common.utils.DateUtils;

class FailureMailService {

    static transactional = true

    public void save(MailMessage msg, String error) {
       FailureMail mail = new FailureMail();
        mail.to = msg.to;
        mail.replyTo = msg.replyTo;
        mail.body = msg.body;
        mail.subject = msg.subject;
        mail.sentTime = DateUtils.now();
        mail.failureMessage = error;
        mail.save(flush: true);
    }
}
